package com.strange.mdl.module.mdl.dal.mysql.debatehall;

import java.util.*;

import com.strange.mdl.framework.common.pojo.PageResult;
import com.strange.mdl.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.strange.mdl.framework.mybatis.core.mapper.BaseMapperX;
import com.strange.mdl.module.mdl.dal.dataobject.dailydharma.DailydharmaDO;
import com.strange.mdl.module.mdl.dal.dataobject.debatehall.DebatehallDO;
import com.strange.mdl.module.mdl.dal.dataobject.debatehall.DebatehallUserDO;
import org.apache.ibatis.annotations.Mapper;
import com.strange.mdl.module.mdl.controller.admin.debatehall.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 辨经殿话题 Mapper
 *
 * @author 密谛灵总控
 */
@Mapper
public interface DebatehallMapper extends BaseMapperX<DebatehallDO> {

//    default PageResult<DebatehallDO> selectPage(DebatehallPageReqVO reqVO) {
//        return selectPage(reqVO, new LambdaQueryWrapperX<DebatehallDO>()
//                .eqIfPresent(DebatehallDO::getContent, reqVO.getContent())
//                .orderByDesc(DebatehallDO::getId));
//    }

    int updateDebateHallUser(DebatehallUserDO entity);
    /**
     * 查询主题列表
     *
     * @param keyword 主题
     * @return 主题集合
     */
    List<DebatehallDO> selectPageList(@Param("keyword") String keyword, @Param("id") Long id);
    Integer selectPageCount(String keyword);

    /**
     * 插入用户参与辩题记录
     */
    int insertEbatehallUsers(DebatehallUserDO entity);


    /**
     * 查询用户是否已参与某个辩题
     *
     * @param debateId 辩题ID
     * @param userId   用户ID
     * @return 用户参与记录实体
     */
    DebatehallUserDO selectEbatehallUsers(@Param("debateId") Long debateId,
                                              @Param("userId") Long userId);

    DebatehallDO getDebateHallUserStatus(@Param("debateId") Long debateId);

    List<DebatehallDO> lastDailydharmaTwo();
}